/*
 * @Author: Clark
 * @Email: haixuanwoTxh@gmail.com
 * @Date: 2023-08-12 14:11:36
 * @LastEditors: Clark
 * @LastEditTime: 2023-08-12 15:00:06
 * @Description: file content
 */

#include "s3c2440_soc.h"

void delay(volatile int d)
{
    while (d--);
}

int main(void)
{
    int val = 0;
    int tmp;

    // 设置GPFCON让GPF4/5/6配置为输出引脚
    GPFCON &= ~((3<<8) | (3<<10) | (3<<12));
    GPFCON |= ((1<<8) | (1<<10) | (1<<12));

    while (1)
    {
        tmp = ~val;
        tmp &= 7;

        GPFDAT &= ~(7<<4);
        GPFDAT |= (tmp<<4);

        delay(100*1000);
        val++;
        if (8 == val)
        {
            val = 0;
        }
    }

    return 0;
}
